<div id="sidebar">
		  <div id="search">
		  <?php include (TEMPLATEPATH . '/searchform.php'); ?>
		  </div>
<ul>
	

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(sidebar) ) : ?>

	<li><?php get_calendar(); ?></li>

	<li><h2>最新发表</h2>
		<ul>
			<?php wp_get_archives('type=postbypost&limit=7'); ?>
		</ul>
	</li>

	<?php if (function_exists('random_posts')) { ?> 
	<li><h2>随机文章</h2>
		<ul>
			<?php random_posts($limit=7); ?>
		</ul>
	</li>
	<?php } ?>
		
		<?php wp_list_categories('orderby=name&show_count=1&title_li=<h2>网志分类</h2>'); ?> 

	<?php if (function_exists('get_recent_comments')) { ?>
	<li><h2>最近回复</h2>
		<ul>
			<?php get_recent_comments(); ?>
		</ul>
	</li>
	<?php } ?>

<?php endif; ?> 
</ul>
</div>